package com.pan.hisystem.controller;


import com.pan.hisystem.pojo.Menu;
import com.pan.hisystem.service.IMenuService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.security.Principal;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author qingyang
 * @since 2022-03-25
 */
@RestController
@RequestMapping("/menu")
public class MenuController {

    @Autowired
    private IMenuService menuService;

    @ApiOperation(value = "通过用户id返回菜单列表")
    @GetMapping("/initMenu")
    public List<Menu> getMenuByUserId(){
        System.out.println("进入initMenu接口");
        return menuService.getMenusByUserId();
    }

}
